//
// Created by zhou on 2021/10/19.
//
#include <iostream>
#include <vector>
using namespace std;
class Solution{
public:
    vector<int> twoSum(vector<int>&numbers,int target){
        vector<int> x(2);
        int size=numbers.size();
        for(int i=0;i<size-1;i++){
            for(int j=i+1;j<size;j++){
                if(numbers[i]+numbers[j]==target)
                {
                    x[0]=i;
                    x[1]=j;
                    break;
                }
                if(numbers[i]+numbers[j]>target)break;
            }

        }
    return x;
    }
};
int main(){
    Solution solution;
    vector<int> nums={1,2,3,4,5,6};
    vector<int> x=solution.twoSum(nums,9);
    cout<<x[0]<<","<<x[1];
    return 0;

}

